Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add arrow strip marker #972

Open
wants to merge 20 commits into
base: rolling
Choose a base branch
from

Conversation

rr-tom-noble
Copy link

@rr-tom-noble rr-tom-noble commented Apr 20, 2023

ROS2 port of this PR

  1. Adds conversion methods between Ogre::ColourValue and msg::ColorRGBA types
  2. Refactors the Arrow class:
    • Splits set() into setHeadLength(), setHeadDiameter(), setShaftLength(), setShaftDiameter() for clarity.
    • adds a setLength() method for setting the total arrow length, preserving shaft and head proportions.
    • adds a setShaftHeadRadio() method for setting shaft and head proportions, preserving the total arrow length.
  3. Refactors code depending on Arrow to use the new methods
  4. Adds an ArrowStripMarker class for rendering batches of arrows efficiently

Note:

While working on point 3, I noticed that there are inconsistencies in the way values are being passed to the (now removed) Arrow::set method. The documentation suggests it accepts shaft and head diameters, whereas the usage suggests some callers are passing in radii.

I've stuck to using diameter for now to preserve existing behaviour and for consistency with the original documentation. It's also more obvious now through the method names i.e. set..Diameter(...radius) where these inconsistencies exist, so it should be clearer for a future PR.

TODO:

  • Finish ArrowStripMarker implementation
  • Port files that don't seem to have ROS2 analogue
  • Apply formatting
  • Add unit tests

@rr-tom-noble rr-tom-noble marked this pull request as ready for review April 24, 2023 11:23
@rr-tom-noble rr-tom-noble requested a review from ahcorde as a code owner April 24, 2023 11:23
@rr-tom-noble
Copy link
Author

rr-tom-noble commented Apr 24, 2023

Hi @ahcorde

The ROS1 version of this PR used a CI mechanism to pull in and compile against unmerged branches from other repositories, which will be required to resolve the dependencies between this one and the common msgs PR adding the new ARROW_STRIP Marker type. Does such a mechanism exist in rviz2?

Also, that PR featured a test Python script demonstrating rendering of the new marker type. Is there a place for these kinds of scripts in rviz2, or should writing the unit tests for the ArrowMarkerStrip class be sufficient?

Also, if you could let me know what tools I should be using to lint & format the code, that'd be super helpful.

@rr-tom-noble
Copy link
Author

@ahcorde
Bump as I won't have much time to work on this from next week

@rr-tom-noble
Copy link
Author

Hi @clalancette, would you be able to answer the questions above?

@rr-tom-noble
Copy link
Author

rr-tom-noble commented May 16, 2023

@ahcorde @clalancette Bump as I'd really like to get this merged soon

@ahcorde
Copy link
Contributor

ahcorde commented Jul 17, 2023

This PR is block with this other PR ros2/common_interfaces#218

@clalancette
Copy link
Contributor

First, I'm sorry for the long delay. May is an extremely busy month leading up to the release, so I just didn't have time to look at this back then. I can answer some questions now.

The ROS1 version of this PR used a CI mechanism to pull in and compile against unmerged branches from other repositories, which will be required to resolve the dependencies between this one and the common msgs PR adding the new ARROW_STRIP Marker type. Does such a mechanism exist in rviz2?

Yes, though it is somewhat more manual. In this case, we use jobs launched on https://ci.ros2.org to do the same thing. Assuming we go forward with this and ros2/common_interfaces#218 , that's the mechanism we'll use.

Also, that PR featured a test Python script demonstrating rendering of the new marker type. Is there a place for these kinds of scripts in rviz2, or should writing the unit tests for the ArrowMarkerStrip class be sufficient?

Um, that's a good question. I don't really know. What I think we should probably do for now is just to keep that separate, but if you could put a link to it somewhere for testing that would be helpful.

Also, if you could let me know what tools I should be using to lint & format the code, that'd be super helpful.

If you follow the installation procedure on http://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Development-Setup.html, you should have all the tools you need. Then you can checkout this branch and the one in common_interfaces, and do:

$ colcon build
$ colcon test --packages-select rviz_common rviz_default_plugins

That should tell you what you need to change.

@ahcorde
Copy link
Contributor

ahcorde commented Apr 11, 2024

do you have plan to continue working on this PR @rr-tom-noble ?

@rr-tom-noble
Copy link
Author

Apologies for letting this get stale. I've had my head in ros1 for a while now, but we're migrating over to humble, so it's giving me more time to get into ros2 again.

I'd definitely be interested in picking this back up over the coming weeks

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you include a similar test src/test/send_arrow_strip_marker.py ?

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants